-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed error when accessing blocks by blocknumber using eth_tester #1660
fixed error when accessing blocks by blocknumber using eth_tester #1660
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have a test added for this as well.
For reference: web3.py/web3/_utils/module_testing/eth_module.py Lines 205 to 210 in 6258d2e
Something like that, but with balance. I'd try to go one step further and say that you can verify that the balances are different on different blocks. Notice that coinbase has a balance at the latest block: web3.py/web3/_utils/module_testing/eth_module.py Lines 124 to 127 in 6258d2e
It seems a good bet that that balance is lower at the genesis block. See if you can verify that in a test. I'd highly recommend reverting the implementation commit, then writing the test and confirming that it fails. (In |
@carver the genesis balance vs. later balance idea is a no-go in at least one case:
however, testing of
|
Sure, you would need to mine a block before that idea would work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, LGTM!
Co-authored-by: Jason Carver <[email protected]>
What was wrong?
When accessing a block by its block number using eth_tester, e.g. 3, the following error occured:
How was it fixed?
With this pull request, the ethereum_tester_middleware is extended by typing instructions for
eth_getBalance
.Cute Animal Picture
Too tired for searching for a cat picture. Meow.